I've got a minor issue with my lathe, in that during the initialisation occasionally it enables then immediately disables an axis.
After a good few attempts I finally produced the issue with the console open. The problem is that when I activate the axis, it sometimes immediately disables due to following error. I know that's now an easy fix, however it's highlighted that my E-stop monitoring code isn't doing what it should, as it fails to handle an axis being disabled when it shouldn't.
The following bit code should detect it-
if ((!ch0->Enable || !ch1->Enable) && !INHOMING){
ClearBit(SYSTEMOK);
estopMes = ESXZFAIL;
//printf("X or Z not enabled\n");
}
Basically if either channel is not enabled, and we're not in homing (axis gets briefly disabled during the homing routine), then an EStop should get triggered.
I'm sure I'm doing something stupid, but I can't figure it out.
I know I could split the logic test out further, but I'm puzzled as to why it won't work in it's current form.
Thanks,
Moray